﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using EmoryResidencyReviewer.Models;

namespace EmoryResidencyReviewer.BusinessLayer
{
	public static class CredentialCheck
	{

		#region Admins

		public static bool AdminCredentialCheck(string username, string password)
		{
			using (var ctx = new EmoryResidencyDataContext(DataConnections.EmoryResidencyConnectionString))
			{
				return (from ad in ctx.Administrators
								where ad.Username.ToUpper() == username.ToUpper()
									&& ad.Password == password
								select ad).Count() > 0;  //return if we found an admin with those correct credentials
			}
		}

		#endregion

		#region Applicants
		#endregion

		#region Recommenders
		#endregion
	}
}